<?php
	session_start();
	
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>Registrar Curso</title>
	<?php
		include("../scripts.php");
	?>
	<script type="text/javascript">
$(function() {
	$('#txtfecha').datepick();
	$('#txtfechaf').datepick();
});

</script>
<style type="text/css">
@import "../css/jquery.datepick.css";
</style>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="../js/jquery.datepick.js"></script>
<script type="text/javascript" src="../js/jquery.datepick-es.js"></script>
<head>	
<body>
	<?php
	
	require_once("../BaseDatos/DBSelect.php");
	require_once("../BaseDatos/DBQuery.php");
	$evento=$_GET["evento"];
	
	$params=array();
	$Query=new DBQuery();
	$sql=new db_class();
	$sql->Connect();
	$params[0]=$evento;
	
	if(isset($_SESSION["evaluador"]))
	{
		$evaluador=$_SESSION["evaluador"];
	}
	$sql->Query($Query->Create("GetCursoe",$params));
	if ($sql->rows>0)
	{
		for($n=0; $n<$sql->rows;$n++)
		{	
			$sql->Fetch($n);
			$data=$sql->data;			
			$nombre=$data["nombre"];
			$lugar=$data["lugar"];
			$descripcion=$data["descripcion"];
			$fecha=$data["fecha"];
			$fechaf=$data["fechafin"];				
			$hourini=$data["horaini"];
			$minini=$data["minutosini"];
			$hourend=$data["horafin"];
			$minend=$data["minutosfin"];
			$id_google=$data["idgooglecurso"];
			$descripcion=str_replace("\r\n","<br/>",$descripcion);

		}
	}
	$sql->Disconnect();
	
?>
<div id="main">	
	<?php
		include("../layout/header.php");
		include("../layout/sidebar.php");			
	?>
<form id="frmrgistrar" method="post" action="Editar.php">
		<div id="registroevento">
			<h1>Editar informaci&oacute;n del evento</h1>
			<hr/>
			
				<!--Nombre del evento-->
				<div  class="divx">
					<label>Nombre</label>
					<input name="txtnombre" type="text" class="input" value="<?php echo $nombre ?>">
				</div>
				<!--lugar del evento-->
				<div  class="divx">
					<label>lugar</label>
					<input name="txtlugar" type="text" class="input" value="<?php echo $lugar ?>">
				</div>
				<!--fecha del evento-->
				<div  class="divx">
					<label>Fecha</label>
					<input name="txtfecha" id="txtfecha"type="text" value="<?php echo $fecha ?>" class="fecha" onclick="setdate();" onchange="setdate();">
				
				<!--hora del evento-->
					<select id="txthora" name="txthora" onchange="settime();">
						<option value="0:00" <?php if(($hourini==0)&&$minini==0) echo "selected"; ?>>12:00 am</option>
						<option value="0:30" <?php if(($hourini==0)&&$minini==30) echo "selected"; ?> >12:30 am</option>
						<option value="1:00" <?php if(($hourini==1)&&$min==0) echo "selected"; ?> >1:00 am </option>
						<option value="1:30" <?php if(($hourini==1)&&$min==30) echo "selected"; ?>>1:30 am</option>
						<option value="2:00" <?php if(($hourini==2)&&$min==0) echo "selected"; ?> >2:00 am</option>
						<option value="2:30" <?php if(($hourini==2)&&$min==30) echo "selected"; ?>>2:30 am</option>
						<option value="3:00" <?php if(($hourini==3)&&$min==0) echo "selected"; ?> >3:00 am</option>
						<option value="3:30" <?php if(($hourini==3)&&$min==30) echo "selected"; ?> >3:30 am</option>
						<option value="4:00" <?php if(($hourini==4)&&$min==0) echo "selected"; ?> >4:00 am</option>
						<option value="4:30" <?php if(($hourini==4)&&$min==30) echo "selected"; ?> >4:30 am</option>
						<option value="5:00" <?php if(($hourini==5)&&$min==0) echo "selected"; ?> >5:00 am</option>
						<option value="5:30" <?php if(($hourini==5)&&$minini==30) echo "selected"; ?> >5:30 am</option>
						<option value="6:00" <?php if(($hourini==6)&&$minini==0) echo "selected"; ?> >6:00 am</option>
						<option value="6:30" <?php if(($hourini==6)&&$minini==30) echo "selected"; ?> >6:30 am</option>
						<option value="7:00" <?php if(($hourini==7)&&$minini==0) echo "selected"; ?> >7:00 am</option>
						<option value="7:30" <?php if(($hourini==7)&&$minini==30) echo "selected"; ?> >7:30 am</option>
						<option value="8:00" <?php if(($hourini==8)&&$minini==0) echo "selected"; ?> >8:00 am</option>
						<option value="8:30" <?php if(($hourini==8)&&$minini==30) echo "selected"; ?> >8:30 am</option>
						<option value="9:00" <?php if(($hourini==9)&&$minini==0) echo "selected"; ?> >9:00 am</option>
						<option value="9:30" <?php if(($hourini==9)&&$minini==30) echo "selected"; ?> >9:30 am</option>
						<option value="10:00" <?php if(($hourini==10)&&$minini==0) echo "selected"; ?> >10:00 am</option>
						<option value="10:30" <?php if(($hourini==10)&&$minini==30) echo "selected"; ?>>10:30 am</option>
						<option value="11:00" <?php if(($hourini==11)&&$minini==0) echo "selected"; ?> >11:00 am</option>
						<option value="11:30" <?php if(($hourini==11)&&$minini==30) echo "selected"; ?> >11:30 am</option>
						<option value="12:00" <?php if(($hourini==12)&&$minini==0) echo "selected"; ?>>12:00 md</option>
						<option value="12:30" <?php if(($hourini==12)&&$minini==30) echo "selected"; ?> >12:30 md</option>
						
						<option value="13:00" <?php if(($hourini==13)&&$min==0) echo "selected"; ?> >1:00 pm </option>
						<option value="13:30" <?php if(($hourini==13)&&$min==30) echo "selected"; ?>>1:30 pm</option>
						<option value="14:00" <?php if(($hourini==14)&&$min==0) echo "selected"; ?> >2:00 pm</option>
						<option value="14:30" <?php if(($hourini==14)&&$min==30) echo "selected"; ?>>2:30 pm</option>
						<option value="15:00" <?php if(($hourini==15)&&$min==0) echo "selected"; ?> >3:00 pm</option>
						<option value="15:30" <?php if(($hourini==15)&&$min==30) echo "selected"; ?> >3:30 pm</option>
						<option value="16:00" <?php if(($hourini==16)&&$min==0) echo "selected"; ?> >4:00 pm</option>
						<option value="16:30" <?php if(($hourini==16)&&$min==30) echo "selected"; ?> >4:30 pm</option>
						<option value="17:00" <?php if(($hourini==17)&&$min==0) echo "selected"; ?> >5:00 pm</option>
						<option value="17:30" <?php if(($hourini==17)&&$minini==30) echo "selected"; ?> >5:30 pm</option>
						<option value="18:00" <?php if(($hourini==18)&&$minini==0) echo "selected"; ?> >6:00 pm</option>
						<option value="18:30" <?php if(($hourini==18)&&$minini==30) echo "selected"; ?> >6:30 pm</option>
						<option value="19:00" <?php if(($hourini==19)&&$minini==0) echo "selected"; ?> >7:00 pm</option>
						<option value="19:30" <?php if(($hourini==19)&&$minini==30) echo "selected"; ?> >7:30 pm</option>
						<option value="20:00" <?php if(($hourini==20)&&$minini==0) echo "selected"; ?> >8:00 pm</option>
						<option value="20:30" <?php if(($hourini==20)&&$minini==30) echo "selected"; ?> >8:30 pm</option>
						<option value="21:00" <?php if(($hourini==21)&&$minini==0) echo "selected"; ?> >9:00 pm</option>
						<option value="21:30" <?php if(($hourini==21)&&$minini==30) echo "selected"; ?> >9:30 pm</option>
						<option value="22:00" <?php if(($hourini==22)&&$minini==0) echo "selected"; ?> >10:00 pm</option>
						<option value="22:30" <?php if(($hourini==22)&&$minini==30) echo "selected"; ?>>10:30 pm</option>
						<option value="23:00" <?php if(($hourini==23)&&$minini==0) echo "selected"; ?> >11:00 pm</option>
						<option value="23:30" <?php if(($hourini==23)&&$minini==30) echo "selected"; ?> >11:30 pm</option>						
					</select>	
					<label class="in">a</label>
					<input name="txtfechaf" id="txtfechaf" type="text" value="<?php echo $fechaf ?>" 
					 class="fecha" onclick="setdate();" onchange="setdate();">
					<!--Hora final-->
					
					<select id="txthoraf" name="txthoraf" onchange="settime();">
						<option value="0:00" <?php if(($hourend==0)&&$minend==0) echo "selected"; ?>>12:00 am</option>
						<option value="0:30" <?php if(($hourend==0)&&$minend==30) echo "selected"; ?> >12:30 am</option>
						<option value="1:00" <?php if(($hourend==1)&&$min==0) echo "selected"; ?> >1:00 am </option>
						<option value="1:30" <?php if(($hourend==1)&&$min==30) echo "selected"; ?>>1:30 am</option>
						<option value="2:00" <?php if(($hourend==2)&&$min==0) echo "selected"; ?> >2:00 am</option>
						<option value="2:30" <?php if(($hourend==2)&&$min==30) echo "selected"; ?>>2:30 am</option>
						<option value="3:00" <?php if(($hourend==3)&&$min==0) echo "selected"; ?> >3:00 am</option>
						<option value="3:30" <?php if(($hourend==3)&&$min==30) echo "selected"; ?> >3:30 am</option>
						<option value="4:00" <?php if(($hourend==4)&&$min==0) echo "selected"; ?> >4:00 am</option>
						<option value="4:30" <?php if(($hourend==4)&&$min==30) echo "selected"; ?> >4:30 am</option>
						<option value="5:00" <?php if(($hourend==5)&&$min==0) echo "selected"; ?> >5:00 am</option>
						<option value="5:30" <?php if(($hourend==5)&&$minend==30) echo "selected"; ?> >5:30 am</option>
						<option value="6:00" <?php if(($hourend==6)&&$minend==0) echo "selected"; ?> >6:00 am</option>
						<option value="6:30" <?php if(($hourend==6)&&$minend==30) echo "selected"; ?> >6:30 am</option>
						<option value="7:00" <?php if(($hourend==7)&&$minend==0) echo "selected"; ?> >7:00 am</option>
						<option value="7:30" <?php if(($hourend==7)&&$minend==30) echo "selected"; ?> >7:30 am</option>
						<option value="8:00" <?php if(($hourend==8)&&$minend==0) echo "selected"; ?> >8:00 am</option>
						<option value="8:30" <?php if(($hourend==8)&&$minend==30) echo "selected"; ?> >8:30 am</option>
						<option value="9:00" <?php if(($hourend==9)&&$minend==0) echo "selected"; ?> >9:00 am</option>
						<option value="9:30" <?php if(($hourend==9)&&$minend==30) echo "selected"; ?> >9:30 am</option>
						<option value="10:00" <?php if(($hourend==10)&&$minend==0) echo "selected"; ?> >10:00 am</option>
						<option value="10:30" <?php if(($hourend==10)&&$minend==30) echo "selected"; ?>>10:30 am</option>
						<option value="11:00" <?php if(($hourend==11)&&$minend==0) echo "selected"; ?> >11:00 am</option>
						<option value="11:30" <?php if(($hourend==11)&&$minend==30) echo "selected"; ?> >11:30 am</option>
						<option value="12:00" <?php if(($hourend==12)&&$minend==0) echo "selected"; ?>>12:00 md</option>
						<option value="12:30" <?php if(($hourend==12)&&$minend==30) echo "selected"; ?> >12:30 md</option>
						
						<option value="13:00" <?php if(($hourend==13)&&$min==0) echo "selected"; ?> >1:00 pm </option>
						<option value="13:30" <?php if(($hourend==13)&&$min==30) echo "selected"; ?>>1:30 pm</option>
						<option value="14:00" <?php if(($hourend==14)&&$min==0) echo "selected"; ?> >2:00 pm</option>
						<option value="14:30" <?php if(($hourend==14)&&$min==30) echo "selected"; ?>>2:30 pm</option>
						<option value="15:00" <?php if(($hourend==15)&&$min==0) echo "selected"; ?> >3:00 pm</option>
						<option value="15:30" <?php if(($hourend==15)&&$min==30) echo "selected"; ?> >3:30 pm</option>
						<option value="16:00" <?php if(($hourend==16)&&$min==0) echo "selected"; ?> >4:00 pm</option>
						<option value="16:30" <?php if(($hourend==16)&&$min==30) echo "selected"; ?> >4:30 pm</option>
						<option value="17:00" <?php if(($hourend==17)&&$min==0) echo "selected"; ?> >5:00 pm</option>
						<option value="17:30" <?php if(($hourend==17)&&$minend==30) echo "selected"; ?> >5:30 pm</option>
						<option value="18:00" <?php if(($hourend==18)&&$minend==0) echo "selected"; ?> >6:00 pm</option>
						<option value="18:30" <?php if(($hourend==18)&&$minend==30) echo "selected"; ?> >6:30 pm</option>
						<option value="19:00" <?php if(($hourend==19)&&$minend==0) echo "selected"; ?> >7:00 pm</option>
						<option value="19:30" <?php if(($hourend==19)&&$minend==30) echo "selected"; ?> >7:30 pm</option>
						<option value="20:00" <?php if(($hourend==20)&&$minend==0) echo "selected"; ?> >8:00 pm</option>
						<option value="20:30" <?php if(($hourend==20)&&$minend==30) echo "selected"; ?> >8:30 pm</option>
						<option value="21:00" <?php if(($hourend==21)&&$minend==0) echo "selected"; ?> >9:00 pm</option>
						<option value="21:30" <?php if(($hourend==21)&&$minend==30) echo "selected"; ?> >9:30 pm</option>
						<option value="22:00" <?php if(($hourend==22)&&$minend==0) echo "selected"; ?> >10:00 pm</option>
						<option value="22:30" <?php if(($hourend==22)&&$minend==30) echo "selected"; ?>>10:30 pm</option>
						<option value="23:00" <?php if(($hourend==23)&&$minend==0) echo "selected"; ?> >11:00 pm</option>
						<option value="23:30" <?php if(($hourend==23)&&$minend==30) echo "selected"; ?> >11:30 pm</option>		
					</select>						
				</div>
				<!--Descripcion del evento-->
				<div  class="divx">
					<label>Descripcion</label>
					<textarea name="txtdescripcion" id="txtdescripcion"><?php echo $descripcion ?></textarea>
				</div>
				<div  class="divx">
					<input type="submit"   value="Aceptar" class="buttom">
				</div>	
			
		</div>	
		<input name="txtcurso" type="hidden" value="<?php echo $evento ?>">
		<input name="txtidgoogle" id="txtidgoogle" value="<?php echo "$id_google"?> " style="display:none;" type="text">
	</form>
	<?php
		include("../layout/footer.php");
	?>
</div>	
</body>
</html>